package com.whfc.mach.enums;

/**
 * @Description: 设备报警规则类型
 * @author: sunguodong
 * @version: 1.0
 * @date: 2019/7/22 11:47
 */
public enum AppMachWarnRuleType {

    FENCE(101, "设备出区域报警", "离开了范围区域", "出区"),
    OILPOS(102, "设备偷漏油报警", "出现偷漏油情况", "漏油"),
    BATTERY(103, "设备电量报警", "出现电量过低情况", "电量"),
    IDLE(104, "设备怠机报警", "怠机时长>%s分钟", "怠机"),
    STOP(105, "设备停机报警", "停机时长>%s分钟", "停机"),
    WORK(106, "设备工作报警", "工作时长>%s分钟", "工作"),
    SPEED(107, "设备超速报警", "行驶速度>%skm/h", "超速"),
    ENGINE(108, "设备系统故障报警", "可能出现系统故障", "系统"),
    DEVICE(109, "拆卸硬件报警", "硬件被拆卸", "硬件"),
    ROTATION(110, "设备倾斜报警", "倾斜角>%s°", "倾斜"),
    FORCE(111, "设备牵引力报警", "牵引力>%sKN", "牵引力");

    private Integer value;

    private String tittle;

    private String detail;

    private String pic;

    AppMachWarnRuleType(Integer value, String tittle, String detail, String pic) {
        this.value = value;
        this.detail = detail;
        this.tittle = tittle;
        this.pic = pic;
    }

    public Integer value() {
        return value;
    }

    public String tittle() {
        return tittle;
    }

    public String detail() {
        return detail;
    }

    public String pic() {
        return pic;
    }


    public static AppMachWarnRuleType parseValue(Integer value) {
        AppMachWarnRuleType[] values = AppMachWarnRuleType.values();
        for (AppMachWarnRuleType machWarnRuleType : values) {
            if (machWarnRuleType.value.equals(value)) {
                return machWarnRuleType;
            }
        }
        return null;
    }

    public static AppMachWarnRuleType parseTittle(String tittle) {
        AppMachWarnRuleType[] values = AppMachWarnRuleType.values();
        for (AppMachWarnRuleType machWarnRuleType : values) {
            if (machWarnRuleType.tittle.equals(tittle)) {
                return machWarnRuleType;
            }
        }
        return null;
    }


}
